<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       div:nth-child(2){
            width: 400px;
            height: 200px;
            background-color: aqua;
        }
        div:nth-child(3){
            width: 400px;
            height: 200px;
            background-color: bisque;
        }
    </style>
</head>
<body>
    <script>
        window.addEventListener('load',function(){

           var div= document.querySelectorAll('div')
        //  onresize  窗口大小事件
           window.addEventListener('resize',function(){
                console.log(window.innerWidth);//浏览器宽度
                if(window.innerWidth<=700){
                    div[1].style.display='none'
                }else{
                    div[1].style.display='block'

                }
           })
        
        })

    </script>
    <div></div>
    <div></div>
</body>
</html>